import { test as base, expect } from '@playwright/test';
import { ServerManager } from './server-manager';


type CustomFixture = {
    serverManager: ServerManager;
    workerData: {
        appUrl: string | undefined
    }
};


export const test = base.extend<{}, CustomFixture>({
    serverManager: [async ({ }, use) => {
        const serverManager = new ServerManager();
        await use(serverManager);
    }, { scope: 'worker' }],
    workerData: [async ({}, use) => {
        await use({ appUrl: undefined });
    }, { scope: 'worker' }]
});

export { expect };